﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZBJF.Warranty.Model;
using ZBJF.Warranty.Model.ViewModel.InsuranceProducts;
namespace ZBJF.Warranty.IBLL
{
    public partial interface IInsuranceProductsService
    {
        InsuranceProducts LoadByID(long id);
        /// <summary>
        /// 根据商家产品ID,获取其映射的所有的基础产品列表（一个产品可能映射了多个基础产品以及打包产品对应的基础产品）
        /// </summary>
        /// <param name="sellerInsuranceProductId">商户产品ID</param>
        /// <returns></returns>
        IQueryable<InsuranceProducts> LoadAllInsuranceProductsBy(long sellerInsuranceProductId);
        /// <summary>
        /// 根据商家产品ID获取其中是打包产品的基础产品
        /// </summary>
        /// <param name="sellerInsuranceProductId"></param>
        /// <returns></returns>
        IQueryable<InsuranceProducts> LoadPackageInsuranceProductsBy(long sellerInsuranceProductId);
        /// <summary>
        /// 根据商家产品ID获取其中不是是打包产品的基础产品
        /// </summary>
        /// <param name="sellerInsuranceProductId"></param>
        /// <returns></returns>
        IQueryable<InsuranceProducts> LoadNotPackageInsuranceProductsBy(long sellerInsuranceProductId);

        /// <summary>
        /// 获取指定价格在价格范围内的基础产品ID集合
        /// </summary>
        /// <param name="productAmount"></param>
        /// <returns></returns>
        List<int> GetInsuranceProductsInPointAmount(decimal productAmount);

        bool IsExist(string productName, long id = 0);
        IQueryable<InsuranceProducts> GetPagingList(InsuranceProductsModel model, out int total);
        /// <summary>
        ///不填参数，默认查询所有基础产品
        /// </summary>
        /// <returns></returns>
        IQueryable<InsuranceProducts> GetInsuranceProductsAll();

        /// <summary>
        /// 获取保险产品信息(生效等待期/保险期限/保险期限单位)
        /// </summary>
        /// <param name="sellerInsuranceProductsId">销售商商品ID</param>
        /// <returns></returns>
        CellPhoneServiceProductInfo GetInsuranceProductsInfo(long sellerInsuranceProductsCode);

        /// <summary>
        /// 获取保险产品的可维修配件等级列表
        /// </summary>
        /// <param name="cellPhoneServiceProjectID">保险产品服务项目ID</param>
        /// <returns></returns>
        List<RepairAccessoriesLevelInfo> GetRepairAccessoriesLevelInfo(int cellPhoneServiceProjectID);

        /// <summary>
        /// 新增基础产品_新
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        bool AddInsuranceProductsBase(InsuranceProductsBase param);

        /// <summary>
        /// 修改基础产品_新
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        bool UpdateInsuranceProductsBase(InsuranceProductsBase param);
    }
}
